package com.example.wallapp;

import java.util.ArrayList;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.ArrayAdapter;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends Activity {
	
	ListView catListView;
    ArrayAdapter arrayAdapter;
    
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        ArrayList image_details = getListData();
        final ListView lv = (ListView) findViewById(R.id.catList);
        lv.setAdapter(new CategoryAdapter(this, image_details));};
       
        /* lv.setOnItemClickListener(new OnItemClickListener(){
        
        		public void onItemClick(AdaterView<?> a, View v, int position, long id){
        			Object o = lv.getItemAtPosition(position);
        			CategoryList catItem = (CategoryList) o;
        			Toast.makeText(MainActivity.this, "Selected :" + " " + catItem, Toast.LENGTH_LONG).show();
        }
       
        }); */
    
    //This is the object that will be displayed
    
	@SuppressWarnings("rawtypes")
	private ArrayList getListData(){
    	ArrayList<CategoryList> results = new ArrayList<CategoryList>();
    	CategoryList catItem = new CategoryList();
    	catItem.setCategory("Nature");
    	results.add(catItem);
    	
    	catItem = new CategoryList();
    	catItem.setCategory("Synthetic");
    	results.add(catItem);
    	
    	catItem = new CategoryList();
    	catItem.setCategory("Organic");
    	results.add(catItem);
    	
    	catItem = new CategoryList();
    	catItem.setCategory("Aesthetic");
    	results.add(catItem);
    	
    	catItem = new CategoryList();
    	catItem.setCategory("Scholastic");
    	results.add(catItem);
    	
    	return results;
    }
}
    

